package com.javafactroy.kunlong.bip.icp.message.data.netty.codec;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;
import com.javafactroy.kunlong.bip.icp.message.base.iface.IMessage;

public class AppMsg2ByteEncoder extends MessageToByteEncoder<IMessage> {
    @Override
    protected void encode(ChannelHandlerContext channelHandlerContext,IMessage msg, ByteBuf byteBuf) throws Exception {
        byteBuf.writeBytes(msg.encode());
    }
}
